<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/api.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<title>CAutoComplete</title>
</head>

<body>
<div id="apiPage">

<div id="apiHeader">
<a href="http://www.yiiframework.com">Yii Framework</a> v1.1.17 Class Reference
</div><!-- end of header -->

<div id="content">
<h1>CAutoComplete</h1>
<div id="nav">
<a href="index.html">All Packages</a>
| <a href="#properties">Properties</a>
| <a href="#methods">Methods</a>
</div>

<table class="summaryTable docClass">
<colgroup>
	<col class="col-name" />
	<col class="col-value" />
</colgroup>
<tr>
  <th>Package</th>
  <td><a href="index.html#system.web.widgets">system.web.widgets</a></td>
</tr>
<tr>
  <th>Inheritance</th>
  <td>class CAutoComplete &raquo;
<a href="CInputWidget.html">CInputWidget</a> &raquo;
<a href="CWidget.html">CWidget</a> &raquo;
<a href="CBaseController.html">CBaseController</a> &raquo;
<a href="CComponent.html">CComponent</a></td>
</tr>
<tr>
  <th>Since</th>
  <td>1.0</td>
</tr>
<tr>
  <th>Source Code</th>
  <td><a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/web/widgets/CAutoComplete.php">framework/web/widgets/CAutoComplete.php</a></td>
</tr>
</table>

<div id="classDescription">
CAutoComplete generates an auto-complete text field.
<br/><br/>
CAutoComplete is based on the <a href="http://plugins.jquery.com/project/autocompletex">jQuery Autocomplete</a>.
<br/><br/>
This class is deprecated since Yii 1.1.3. Consider using CJuiAutoComplete.
There is <a href="http://www.learningjquery.com/2010/06/autocomplete-migration-guide">a good migration guide from the author of both JavaScript solutions</a>.</div>
<a name="properties"></a>

<div class="summary docProperty">
<h2>Public Properties</h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-property" />
	<col class="col-type" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
<tr class="inherited" id="actionPrefix">
  <td><a href="CWidget.html#actionPrefix-detail">actionPrefix</a></td>
  <td>string</td>
  <td>the prefix to the IDs of the <a href="CAutoComplete.html#actions">actions</a>.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="attribute">
  <td><a href="CInputWidget.html#attribute-detail">attribute</a></td>
  <td>string</td>
  <td>the attribute associated with this widget.</td>
  <td><a href="CInputWidget.html">CInputWidget</a></td>
</tr>
<tr id="autoFill">
  <td><a href="CAutoComplete.html#autoFill-detail">autoFill</a></td>
  <td>boolean</td>
  <td>fill the textinput while still selecting a value, replacing the value
if more is typed or something else is selected.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="cacheLength">
  <td><a href="CAutoComplete.html#cacheLength-detail">cacheLength</a></td>
  <td>integer</td>
  <td>the number of backend query results to store in cache.</td>
  <td>CAutoComplete</td>
</tr>
<tr class="inherited" id="controller">
  <td><a href="CWidget.html#controller-detail">controller</a></td>
  <td><a href="CController.html">CController</a></td>
  <td>Returns the controller that this widget belongs to.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr id="cssFile">
  <td><a href="CAutoComplete.html#cssFile-detail">cssFile</a></td>
  <td>mixed</td>
  <td>the CSS file used for the widget.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="data">
  <td><a href="CAutoComplete.html#data-detail">data</a></td>
  <td>array</td>
  <td>data that would be saved as client-side data to provide candidate selections.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="delay">
  <td><a href="CAutoComplete.html#delay-detail">delay</a></td>
  <td>integer</td>
  <td>the delay in milliseconds the autocompleter waits after
a keystroke to activate itself.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="extraParams">
  <td><a href="CAutoComplete.html#extraParams-detail">extraParams</a></td>
  <td>array</td>
  <td>extra parameters for the backend.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="formatItem">
  <td><a href="CAutoComplete.html#formatItem-detail">formatItem</a></td>
  <td>string</td>
  <td>a javascript function that provides advanced markup for an item.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="formatMatch">
  <td><a href="CAutoComplete.html#formatMatch-detail">formatMatch</a></td>
  <td>string</td>
  <td>a javascript function that can be used to limit the data that autocomplete
searches for matches.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="formatResult">
  <td><a href="CAutoComplete.html#formatResult-detail">formatResult</a></td>
  <td>string</td>
  <td>a javascript function that provides the formatting for the value to be
put into the input field.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="highlight">
  <td><a href="CAutoComplete.html#highlight-detail">highlight</a></td>
  <td>boolean|string</td>
  <td>Whether and how to highlight matches in the select box.</td>
  <td>CAutoComplete</td>
</tr>
<tr class="inherited" id="htmlOptions">
  <td><a href="CInputWidget.html#htmlOptions-detail">htmlOptions</a></td>
  <td>array</td>
  <td>additional HTML options to be rendered in the input tag</td>
  <td><a href="CInputWidget.html">CInputWidget</a></td>
</tr>
<tr class="inherited" id="id">
  <td><a href="CWidget.html#id-detail">id</a></td>
  <td>string</td>
  <td>Returns the ID of the widget or generates a new one if requested.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr id="inputClass">
  <td><a href="CAutoComplete.html#inputClass-detail">inputClass</a></td>
  <td>string</td>
  <td>the CSS class for the input element.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="loadingClass">
  <td><a href="CAutoComplete.html#loadingClass-detail">loadingClass</a></td>
  <td>string</td>
  <td>the CSS class used when the data is being loaded from backend.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="matchCase">
  <td><a href="CAutoComplete.html#matchCase-detail">matchCase</a></td>
  <td>boolean</td>
  <td>whether or not the comparison is case sensitive.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="matchContains">
  <td><a href="CAutoComplete.html#matchContains-detail">matchContains</a></td>
  <td>boolean</td>
  <td>whether or not the comparison looks inside
(i.e. does "ba" match "foo bar") the search results.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="matchSubset">
  <td><a href="CAutoComplete.html#matchSubset-detail">matchSubset</a></td>
  <td>boolean</td>
  <td>whether or not the autocompleter can use a cache for more
specific queries.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="max">
  <td><a href="CAutoComplete.html#max-detail">max</a></td>
  <td>integer</td>
  <td>limit the number of items in the select box.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="methodChain">
  <td><a href="CAutoComplete.html#methodChain-detail">methodChain</a></td>
  <td>string</td>
  <td>the chain of method calls that would be appended at the end of the autocomplete constructor.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="minChars">
  <td><a href="CAutoComplete.html#minChars-detail">minChars</a></td>
  <td>integer</td>
  <td>the minimum number of characters a user has to type before
the autocompleter activates.</td>
  <td>CAutoComplete</td>
</tr>
<tr class="inherited" id="model">
  <td><a href="CInputWidget.html#model-detail">model</a></td>
  <td><a href="CModel.html">CModel</a></td>
  <td>the data model associated with this widget.</td>
  <td><a href="CInputWidget.html">CInputWidget</a></td>
</tr>
<tr id="multiple">
  <td><a href="CAutoComplete.html#multiple-detail">multiple</a></td>
  <td>boolean</td>
  <td>whether to allow more than one autocompleted-value to enter.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="multipleSeparator">
  <td><a href="CAutoComplete.html#multipleSeparator-detail">multipleSeparator</a></td>
  <td>string</td>
  <td>seperator to put between values when using multiple option.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="mustMatch">
  <td><a href="CAutoComplete.html#mustMatch-detail">mustMatch</a></td>
  <td>boolean</td>
  <td>if set to true, the autocompleter will only allow results that
are presented by the backend.</td>
  <td>CAutoComplete</td>
</tr>
<tr class="inherited" id="name">
  <td><a href="CInputWidget.html#name-detail">name</a></td>
  <td>string</td>
  <td>the input name.</td>
  <td><a href="CInputWidget.html">CInputWidget</a></td>
</tr>
<tr id="options">
  <td><a href="CAutoComplete.html#options-detail">options</a></td>
  <td>array</td>
  <td>additional options that can be passed to the constructor of the autocomplete js object.</td>
  <td>CAutoComplete</td>
</tr>
<tr class="inherited" id="owner">
  <td><a href="CWidget.html#owner-detail">owner</a></td>
  <td><a href="CBaseController.html">CBaseController</a></td>
  <td>Returns the owner/creator of this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr id="resultsClass">
  <td><a href="CAutoComplete.html#resultsClass-detail">resultsClass</a></td>
  <td>string</td>
  <td>the CSS class for the dropdown list.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="scroll">
  <td><a href="CAutoComplete.html#scroll-detail">scroll</a></td>
  <td>boolean</td>
  <td>whether to scroll when more results than configured via scrollHeight are available.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="scrollHeight">
  <td><a href="CAutoComplete.html#scrollHeight-detail">scrollHeight</a></td>
  <td>integer</td>
  <td>height of scrolled autocomplete control in pixels.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="selectFirst">
  <td><a href="CAutoComplete.html#selectFirst-detail">selectFirst</a></td>
  <td>boolean</td>
  <td>if this is set to true, the first autocomplete value will
be automatically selected on tab/return, even if it has not been handpicked
by keyboard or mouse action.</td>
  <td>CAutoComplete</td>
</tr>
<tr class="inherited" id="skin">
  <td><a href="CWidget.html#skin-detail">skin</a></td>
  <td>mixed</td>
  <td>the name of the skin to be used by this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr id="textArea">
  <td><a href="CAutoComplete.html#textArea-detail">textArea</a></td>
  <td>boolean</td>
  <td>whether to show the autocomplete using a text area.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="url">
  <td><a href="CAutoComplete.html#url-detail">url</a></td>
  <td>string|array</td>
  <td>the URL that can return the candidate selections.</td>
  <td>CAutoComplete</td>
</tr>
<tr class="inherited" id="value">
  <td><a href="CInputWidget.html#value-detail">value</a></td>
  <td>string</td>
  <td>the input value</td>
  <td><a href="CInputWidget.html">CInputWidget</a></td>
</tr>
<tr class="inherited" id="viewPath">
  <td><a href="CWidget.html#viewPath-detail">viewPath</a></td>
  <td>string</td>
  <td>Returns the directory containing the view files for this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr id="width">
  <td><a href="CAutoComplete.html#width-detail">width</a></td>
  <td>integer</td>
  <td>specify a custom width for the select box.</td>
  <td>CAutoComplete</td>
</tr>
</table>
</div>
<div class="summary docProperty">
<h2>Protected Properties</h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-property" />
	<col class="col-type" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
<tr id="clientOptions">
  <td><a href="CAutoComplete.html#clientOptions-detail">clientOptions</a></td>
  <td>array</td>
  <td>the javascript options</td>
  <td>CAutoComplete</td>
</tr>
</table>
</div>
<a name="methods"></a>

<div class="summary docMethod">
<h2>Public Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-method" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
<tr class="inherited" id="__call">
  <td><a href="CComponent.html#__call-detail">__call()</a></td>
  <td>Calls the named method which is not a class method.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="__construct">
  <td><a href="CWidget.html#__construct-detail">__construct()</a></td>
  <td>Constructor.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="__get">
  <td><a href="CComponent.html#__get-detail">__get()</a></td>
  <td>Returns a property value, an event handler list or a behavior based on its name.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="__isset">
  <td><a href="CComponent.html#__isset-detail">__isset()</a></td>
  <td>Checks if a property value is null.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="__set">
  <td><a href="CComponent.html#__set-detail">__set()</a></td>
  <td>Sets value of a component property.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="__unset">
  <td><a href="CComponent.html#__unset-detail">__unset()</a></td>
  <td>Sets a component property to be null.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="actions">
  <td><a href="CWidget.html#actions-detail">actions()</a></td>
  <td>Returns a list of actions that are used by this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="asa">
  <td><a href="CComponent.html#asa-detail">asa()</a></td>
  <td>Returns the named behavior object.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="attachBehavior">
  <td><a href="CComponent.html#attachBehavior-detail">attachBehavior()</a></td>
  <td>Attaches a behavior to this component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="attachBehaviors">
  <td><a href="CComponent.html#attachBehaviors-detail">attachBehaviors()</a></td>
  <td>Attaches a list of behaviors to the component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="attachEventHandler">
  <td><a href="CComponent.html#attachEventHandler-detail">attachEventHandler()</a></td>
  <td>Attaches an event handler to an event.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="beginCache">
  <td><a href="CBaseController.html#beginCache-detail">beginCache()</a></td>
  <td>Begins fragment caching.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="beginClip">
  <td><a href="CBaseController.html#beginClip-detail">beginClip()</a></td>
  <td>Begins recording a clip.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="beginContent">
  <td><a href="CBaseController.html#beginContent-detail">beginContent()</a></td>
  <td>Begins the rendering of content that is to be decorated by the specified view.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="beginWidget">
  <td><a href="CBaseController.html#beginWidget-detail">beginWidget()</a></td>
  <td>Creates a widget and executes it.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="canGetProperty">
  <td><a href="CComponent.html#canGetProperty-detail">canGetProperty()</a></td>
  <td>Determines whether a property can be read.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="canSetProperty">
  <td><a href="CComponent.html#canSetProperty-detail">canSetProperty()</a></td>
  <td>Determines whether a property can be set.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="createWidget">
  <td><a href="CBaseController.html#createWidget-detail">createWidget()</a></td>
  <td>Creates a widget and initializes it.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="detachBehavior">
  <td><a href="CComponent.html#detachBehavior-detail">detachBehavior()</a></td>
  <td>Detaches a behavior from the component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="detachBehaviors">
  <td><a href="CComponent.html#detachBehaviors-detail">detachBehaviors()</a></td>
  <td>Detaches all behaviors from the component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="detachEventHandler">
  <td><a href="CComponent.html#detachEventHandler-detail">detachEventHandler()</a></td>
  <td>Detaches an existing event handler.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="disableBehavior">
  <td><a href="CComponent.html#disableBehavior-detail">disableBehavior()</a></td>
  <td>Disables an attached behavior.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="disableBehaviors">
  <td><a href="CComponent.html#disableBehaviors-detail">disableBehaviors()</a></td>
  <td>Disables all behaviors attached to this component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="enableBehavior">
  <td><a href="CComponent.html#enableBehavior-detail">enableBehavior()</a></td>
  <td>Enables an attached behavior.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="enableBehaviors">
  <td><a href="CComponent.html#enableBehaviors-detail">enableBehaviors()</a></td>
  <td>Enables all behaviors attached to this component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="endCache">
  <td><a href="CBaseController.html#endCache-detail">endCache()</a></td>
  <td>Ends fragment caching.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="endClip">
  <td><a href="CBaseController.html#endClip-detail">endClip()</a></td>
  <td>Ends recording a clip.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="endContent">
  <td><a href="CBaseController.html#endContent-detail">endContent()</a></td>
  <td>Ends the rendering of content.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="endWidget">
  <td><a href="CBaseController.html#endWidget-detail">endWidget()</a></td>
  <td>Ends the execution of the named widget.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="evaluateExpression">
  <td><a href="CComponent.html#evaluateExpression-detail">evaluateExpression()</a></td>
  <td>Evaluates a PHP expression or callback under the context of this component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="getController">
  <td><a href="CWidget.html#getController-detail">getController()</a></td>
  <td>Returns the controller that this widget belongs to.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="getEventHandlers">
  <td><a href="CComponent.html#getEventHandlers-detail">getEventHandlers()</a></td>
  <td>Returns the list of attached event handlers for an event.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="getId">
  <td><a href="CWidget.html#getId-detail">getId()</a></td>
  <td>Returns the ID of the widget or generates a new one if requested.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="getOwner">
  <td><a href="CWidget.html#getOwner-detail">getOwner()</a></td>
  <td>Returns the owner/creator of this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="getViewFile">
  <td><a href="CWidget.html#getViewFile-detail">getViewFile()</a></td>
  <td>Looks for the view script file according to the view name.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="getViewPath">
  <td><a href="CWidget.html#getViewPath-detail">getViewPath()</a></td>
  <td>Returns the directory containing the view files for this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="hasEvent">
  <td><a href="CComponent.html#hasEvent-detail">hasEvent()</a></td>
  <td>Determines whether an event is defined.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="hasEventHandler">
  <td><a href="CComponent.html#hasEventHandler-detail">hasEventHandler()</a></td>
  <td>Checks whether the named event has attached handlers.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="hasProperty">
  <td><a href="CComponent.html#hasProperty-detail">hasProperty()</a></td>
  <td>Determines whether a property is defined.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr id="init">
  <td><a href="CAutoComplete.html#init-detail">init()</a></td>
  <td>Initializes the widget.</td>
  <td>CAutoComplete</td>
</tr>
<tr class="inherited" id="raiseEvent">
  <td><a href="CComponent.html#raiseEvent-detail">raiseEvent()</a></td>
  <td>Raises an event.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr id="registerClientScript">
  <td><a href="CAutoComplete.html#registerClientScript-detail">registerClientScript()</a></td>
  <td>Registers the needed CSS and JavaScript.</td>
  <td>CAutoComplete</td>
</tr>
<tr id="registerCssFile">
  <td><a href="CAutoComplete.html#registerCssFile-detail">registerCssFile()</a></td>
  <td>Registers the needed CSS file.</td>
  <td>CAutoComplete</td>
</tr>
<tr class="inherited" id="render">
  <td><a href="CWidget.html#render-detail">render()</a></td>
  <td>Renders a view.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="renderFile">
  <td><a href="CBaseController.html#renderFile-detail">renderFile()</a></td>
  <td>Renders a view file.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="renderInternal">
  <td><a href="CBaseController.html#renderInternal-detail">renderInternal()</a></td>
  <td>Renders a view file.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="run">
  <td><a href="CWidget.html#run-detail">run()</a></td>
  <td>Executes the widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="setId">
  <td><a href="CWidget.html#setId-detail">setId()</a></td>
  <td>Sets the ID of the widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="widget">
  <td><a href="CBaseController.html#widget-detail">widget()</a></td>
  <td>Creates a widget and executes it.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
</table>
</div>
<div class="summary docMethod">
<h2>Protected Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-method" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
<tr id="getClientOptions">
  <td><a href="CAutoComplete.html#getClientOptions-detail">getClientOptions()</a></td>
  <td>Returns the javascript options</td>
  <td>CAutoComplete</td>
</tr>
<tr class="inherited" id="hasModel">
  <td><a href="CInputWidget.html#hasModel-detail">hasModel()</a></td>
  <td>Determines whether this widget is associated with a data model.</td>
  <td><a href="CInputWidget.html">CInputWidget</a></td>
</tr>
<tr class="inherited" id="resolveNameID">
  <td><a href="CInputWidget.html#resolveNameID-detail">resolveNameID()</a></td>
  <td></td>
  <td><a href="CInputWidget.html">CInputWidget</a></td>
</tr>
</table>
</div>
<a name="events"></a>

<h2>Property Details</h2>
<div class="detailHeader" id="autoFill-detail">
autoFill<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean <b>$autoFill</b>;</div>

<p>fill the textinput while still selecting a value, replacing the value
if more is typed or something else is selected. Defaults to false.</p>


<div class="detailHeader" id="cacheLength-detail">
cacheLength<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public integer <b>$cacheLength</b>;</div>

<p>the number of backend query results to store in cache.
If set to 1 (the current result), no caching will happen. Must be >= 1. Defaults to 10.</p>


<div class="detailHeader" id="clientOptions-detail">
clientOptions<span class="detailHeaderTag">
property
 <em>read-only</em> </span>
</div>

<div class="signature">
protected array <a href="CAutoComplete.html#getClientOptions"><b>getClientOptions</b></a>()</div>

<p>the javascript options</p>


<div class="detailHeader" id="cssFile-detail">
cssFile<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public mixed <b>$cssFile</b>;</div>

<p>the CSS file used for the widget. Defaults to null, meaning
using the default CSS file included together with the widget.
If false, no CSS file will be used. Otherwise, the specified CSS file
will be included when using this widget.</p>


<div class="detailHeader" id="data-detail">
data<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public array <b>$data</b>;</div>

<p>data that would be saved as client-side data to provide candidate selections.
Each array element can be string or an associative array.
The <a href="CAutoComplete.html#url">url</a> property will be ignored if this property is set.</p>

<div class="SeeAlso">
<h4>See Also</h4>
<ul>
	<li><a href="CAutoComplete.html#url">url</a></li>
</ul>
</div>

<div class="detailHeader" id="delay-detail">
delay<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public integer <b>$delay</b>;</div>

<p>the delay in milliseconds the autocompleter waits after
a keystroke to activate itself. Defaults to 400.</p>


<div class="detailHeader" id="extraParams-detail">
extraParams<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public array <b>$extraParams</b>;</div>

<p>extra parameters for the backend. If you were to specify
array('bar'=>4), the autocompleter would call the backend with a GET
parameter 'bar' 4. The param can be a function that is called to calculate
the param before each request.</p>


<div class="detailHeader" id="formatItem-detail">
formatItem<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$formatItem</b>;</div>

<p>a javascript function that provides advanced markup for an item.
For each row of results, this function will be called. The returned value will
be displayed inside an LI element in the results list. Autocompleter will
provide 4 parameters: the results row, the position of the row in the list of
results (starting at 1), the number of items in the list of results and the search term.
The default behavior assumes that a single row contains a single value.</p>


<div class="detailHeader" id="formatMatch-detail">
formatMatch<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$formatMatch</b>;</div>

<p>a javascript function that can be used to limit the data that autocomplete
searches for matches. For example, there may be items you want displayed to the user,
but don't want included in the data that's searched. The function is called with the same arguments
as <a href="CAutoComplete.html#formatItem">formatItem</a>. Defaults to formatItem.</p>


<div class="detailHeader" id="formatResult-detail">
formatResult<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$formatResult</b>;</div>

<p>a javascript function that provides the formatting for the value to be
put into the input field. Again three arguments: Data, position (starting with one) and
total number of data. The default behavior assumes either plain data to use as result
or uses the same value as provided by formatItem.</p>


<div class="detailHeader" id="highlight-detail">
highlight<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean|string <b>$highlight</b>;</div>

<p>Whether and how to highlight matches in the select box.
Set to false to disable. Set to a javascript function to customize.
The function gets the value as the first argument and the search term as the
second and must return the formatted value. Defaults to Wraps the search term in a &lt;strong&gt; element.</p>


<div class="detailHeader" id="inputClass-detail">
inputClass<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$inputClass</b>;</div>

<p>the CSS class for the input element. Defaults to "ac_input".</p>


<div class="detailHeader" id="loadingClass-detail">
loadingClass<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$loadingClass</b>;</div>

<p>the CSS class used when the data is being loaded from backend. Defaults to "ac_loading".</p>


<div class="detailHeader" id="matchCase-detail">
matchCase<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean <b>$matchCase</b>;</div>

<p>whether or not the comparison is case sensitive. Important
only if you use caching. Defaults to false.</p>


<div class="detailHeader" id="matchContains-detail">
matchContains<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean <b>$matchContains</b>;</div>

<p>whether or not the comparison looks inside
(i.e. does "ba" match "foo bar") the search results. Important only if
you use caching. Don't mix with autofill. Defaults to false.</p>


<div class="detailHeader" id="matchSubset-detail">
matchSubset<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean <b>$matchSubset</b>;</div>

<p>whether or not the autocompleter can use a cache for more
specific queries. This means that all matches of "foot" are a subset
of all matches for "foo". Usually this is true, and using this options
decreases server load and increases performance. Only useful with
cacheLength settings bigger than one, like 10. Defaults to true.</p>


<div class="detailHeader" id="max-detail">
max<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public integer <b>$max</b>;</div>

<p>limit the number of items in the select box. Is also sent as
a "limit" parameter with a remote request. Defaults to 10.</p>


<div class="detailHeader" id="methodChain-detail">
methodChain<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$methodChain</b>;</div>

<p>the chain of method calls that would be appended at the end of the autocomplete constructor.
For example, ".result(function(...){})" would cause the specified js function to execute
when the user selects an option.</p>


<div class="detailHeader" id="minChars-detail">
minChars<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public integer <b>$minChars</b>;</div>

<p>the minimum number of characters a user has to type before
the autocompleter activates. Defaults to 1.</p>


<div class="detailHeader" id="multiple-detail">
multiple<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean <b>$multiple</b>;</div>

<p>whether to allow more than one autocompleted-value to enter. Defaults to false.</p>


<div class="detailHeader" id="multipleSeparator-detail">
multipleSeparator<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$multipleSeparator</b>;</div>

<p>seperator to put between values when using multiple option. Defaults to ", ".</p>


<div class="detailHeader" id="mustMatch-detail">
mustMatch<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean <b>$mustMatch</b>;</div>

<p>if set to true, the autocompleter will only allow results that
are presented by the backend. Note that illegal values result in an empty
input box. Defaults to false.</p>


<div class="detailHeader" id="options-detail">
options<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public array <b>$options</b>;</div>

<p>additional options that can be passed to the constructor of the autocomplete js object.
This allows you to override existing functions of the autocomplete js class (e.g. the parse() function)
<br/><br/>
If you want to provide JavaScript native code, you have to wrap the string with <a href="CJavaScriptExpression.html">CJavaScriptExpression</a> otherwise it will
be enclosed by quotes.</p>


<div class="detailHeader" id="resultsClass-detail">
resultsClass<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$resultsClass</b>;</div>

<p>the CSS class for the dropdown list. Defaults to "ac_results".</p>


<div class="detailHeader" id="scroll-detail">
scroll<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean <b>$scroll</b>;</div>

<p>whether to scroll when more results than configured via scrollHeight are available. Defaults to true.</p>


<div class="detailHeader" id="scrollHeight-detail">
scrollHeight<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public integer <b>$scrollHeight</b>;</div>

<p>height of scrolled autocomplete control in pixels. Defaults to 180.</p>


<div class="detailHeader" id="selectFirst-detail">
selectFirst<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean <b>$selectFirst</b>;</div>

<p>if this is set to true, the first autocomplete value will
be automatically selected on tab/return, even if it has not been handpicked
by keyboard or mouse action. If there is a handpicked (highlighted) result,
that result will take precedence. Defaults to true.</p>


<div class="detailHeader" id="textArea-detail">
textArea<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean <b>$textArea</b>;</div>

<p>whether to show the autocomplete using a text area. Defaults to false,
meaning a text field is used.</p>


<div class="detailHeader" id="url-detail">
url<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string|array <b>$url</b>;</div>

<p>the URL that can return the candidate selections.
A 'q' GET parameter will be sent with the URL which contains what the user has entered so far.
If the URL is given as an array, it is considered as a route to a controller action and will
be used to generate a URL using <a href="CController.html#createUrl">CController::createUrl</a>;
If the URL is an empty string, the currently requested URL is used.
This property will be ignored if <a href="CAutoComplete.html#data">data</a> is set.</p>

<div class="SeeAlso">
<h4>See Also</h4>
<ul>
	<li><a href="CAutoComplete.html#data">data</a></li>
</ul>
</div>

<div class="detailHeader" id="width-detail">
width<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public integer <b>$width</b>;</div>

<p>specify a custom width for the select box. Defaults to the width of the input element.</p>


<h2>Method Details</h2>

<div class="detailHeader" id="getClientOptions-detail">
getClientOptions()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
protected array <b>getClientOptions</b>()</div>
</td></tr>
<tr>
  <td class="paramNameCol">{return}</td>
  <td class="paramTypeCol">array</td>
  <td class="paramDescCol">the javascript options</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/web/widgets/CAutoComplete.php#L265">framework/web/widgets/CAutoComplete.php#265</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">protected&nbsp;function&nbsp;</span><span style="color: #0000BB">getClientOptions</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;static&nbsp;</span><span style="color: #0000BB">$properties</span><span style="color: #007700">=array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'minChars'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'delay'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'cacheLength'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'matchSubset'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'matchCase'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'matchContains'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'mustMatch'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'selectFirst'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'extraParams'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'multiple'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'multipleSeparator'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'width'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'autoFill'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'max'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'scroll'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'scrollHeight'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'inputClass'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'resultsClass'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'loadingClass'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;static&nbsp;</span><span style="color: #0000BB">$functions</span><span style="color: #007700">=array(</span><span style="color: #DD0000">'formatItem'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'formatMatch'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'formatResult'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'highlight'</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">options</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$properties&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$property</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">$property</span><span style="color: #007700">!==</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">[</span><span style="color: #0000BB">$property</span><span style="color: #007700">]=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">$property</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$functions&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$func</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">$func</span><span style="color: #007700">!==</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">$func&nbsp;</span><span style="color: #007700">instanceof&nbsp;</span><span style="color: #0000BB">CJavaScriptExpression</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">[</span><span style="color: #0000BB">$func</span><span style="color: #007700">]=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">$func</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">[</span><span style="color: #0000BB">$func</span><span style="color: #007700">]=new&nbsp;</span><span style="color: #0000BB">CJavaScriptExpression</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">$func</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">;<br />}</span>
</span>
</code></div>
</div>
<p></p>


<div class="detailHeader" id="init-detail">
init()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>init</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/web/widgets/CAutoComplete.php#L201">framework/web/widgets/CAutoComplete.php#201</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">init</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;list(</span><span style="color: #0000BB">$name</span><span style="color: #007700">,</span><span style="color: #0000BB">$id</span><span style="color: #007700">)=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">resolveNameID</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;if(isset(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">htmlOptions</span><span style="color: #007700">[</span><span style="color: #DD0000">'id'</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$id</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">htmlOptions</span><span style="color: #007700">[</span><span style="color: #DD0000">'id'</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">htmlOptions</span><span style="color: #007700">[</span><span style="color: #DD0000">'id'</span><span style="color: #007700">]=</span><span style="color: #0000BB">$id</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;if(isset(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">htmlOptions</span><span style="color: #007700">[</span><span style="color: #DD0000">'name'</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$name</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">htmlOptions</span><span style="color: #007700">[</span><span style="color: #DD0000">'name'</span><span style="color: #007700">];<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">registerClientScript</span><span style="color: #007700">();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">hasModel</span><span style="color: #007700">())<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$field</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">textArea&nbsp;</span><span style="color: #007700">?&nbsp;</span><span style="color: #DD0000">'activeTextArea'&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #DD0000">'activeTextField'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">CHtml</span><span style="color: #007700">::</span><span style="color: #0000BB">$field</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">model</span><span style="color: #007700">,</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">attribute</span><span style="color: #007700">,</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">htmlOptions</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$field</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">textArea&nbsp;</span><span style="color: #007700">?&nbsp;</span><span style="color: #DD0000">'textArea'&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #DD0000">'textField'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">CHtml</span><span style="color: #007700">::</span><span style="color: #0000BB">$field</span><span style="color: #007700">(</span><span style="color: #0000BB">$name</span><span style="color: #007700">,</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">value</span><span style="color: #007700">,</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">htmlOptions</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}</span>
</span>
</code></div>
</div>
<p>Initializes the widget.
This method registers all needed client scripts and renders
the autocomplete input.</p>


<div class="detailHeader" id="registerClientScript-detail">
registerClientScript()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>registerClientScript</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/web/widgets/CAutoComplete.php#L228">framework/web/widgets/CAutoComplete.php#228</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">registerClientScript</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$id</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">htmlOptions</span><span style="color: #007700">[</span><span style="color: #DD0000">'id'</span><span style="color: #007700">];<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$acOptions</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getClientOptions</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">=</span><span style="color: #0000BB">$acOptions</span><span style="color: #007700">===array()?</span><span style="color: #DD0000">'{}'&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">CJavaScript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$acOptions</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cs</span><span style="color: #007700">=</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getClientScript</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cs</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">registerCoreScript</span><span style="color: #007700">(</span><span style="color: #DD0000">'autocomplete'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">data</span><span style="color: #007700">!==</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">=</span><span style="color: #0000BB">CJavaScript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">data</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$url</span><span style="color: #007700">=</span><span style="color: #0000BB">CHtml</span><span style="color: #007700">::</span><span style="color: #0000BB">normalizeUrl</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">url</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">=</span><span style="color: #DD0000">'"'</span><span style="color: #007700">.</span><span style="color: #0000BB">$url</span><span style="color: #007700">.</span><span style="color: #DD0000">'"'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cs</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">registerScript</span><span style="color: #007700">(</span><span style="color: #DD0000">'Yii.CAutoComplete#'</span><span style="color: #007700">.</span><span style="color: #0000BB">$id</span><span style="color: #007700">,</span><span style="color: #DD0000">"jQuery(\"#</span><span style="color: #007700">{</span><span style="color: #0000BB">$id</span><span style="color: #007700">}</span><span style="color: #DD0000">\").legacyautocomplete(</span><span style="color: #0000BB">$data</span><span style="color: #DD0000">,</span><span style="color: #007700">{</span><span style="color: #0000BB">$options</span><span style="color: #007700">}</span><span style="color: #DD0000">)</span><span style="color: #007700">{</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">methodChain</span><span style="color: #007700">}</span><span style="color: #DD0000">;"</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cssFile</span><span style="color: #007700">!==</span><span style="color: #0000BB">false</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">registerCssFile</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cssFile</span><span style="color: #007700">);<br />}</span>
</span>
</code></div>
</div>
<p>Registers the needed CSS and JavaScript.</p>


<div class="detailHeader" id="registerCssFile-detail">
registerCssFile()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public static void <b>registerCssFile</b>(string $url=NULL)</div>
</td></tr>
<tr>
  <td class="paramNameCol">$url</td>
  <td class="paramTypeCol">string</td>
  <td class="paramDescCol">the CSS URL. If null, a default CSS URL will be used.</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/web/widgets/CAutoComplete.php#L254">framework/web/widgets/CAutoComplete.php#254</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;static&nbsp;function&nbsp;</span><span style="color: #0000BB">registerCssFile</span><span style="color: #007700">(</span><span style="color: #0000BB">$url</span><span style="color: #007700">=</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cs</span><span style="color: #007700">=</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getClientScript</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$url</span><span style="color: #007700">===</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$url</span><span style="color: #007700">=</span><span style="color: #0000BB">$cs</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getCoreScriptUrl</span><span style="color: #007700">().</span><span style="color: #DD0000">'/autocomplete/jquery.autocomplete.css'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cs</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">registerCssFile</span><span style="color: #007700">(</span><span style="color: #0000BB">$url</span><span style="color: #007700">);<br />}</span>
</span>
</code></div>
</div>
<p>Registers the needed CSS file.</p>


</div><!-- end of content -->

<div id="apiFooter">
&copy; 2008-2013 by <a href="http://www.yiisoft.com">Yii Software LLC</a><br/>
All Rights Reserved.<br/>
</div><!-- end of footer -->

<script type="text/javascript">
/*<![CDATA[*/
$("a.toggle").toggle(function(){
	$(this).text($(this).text().replace(/Hide/,'Show'));
	$(this).parents(".summary").find(".inherited").hide();
},function(){
	$(this).text($(this).text().replace(/Show/,'Hide'));
	$(this).parents(".summary").find(".inherited").show();
});
$(".sourceCode a.show").toggle(function(){
	$(this).text($(this).text().replace(/show/,'hide'));
	$(this).parents(".sourceCode").find("div.code").show();
},function(){
	$(this).text($(this).text().replace(/hide/,'show'));
	$(this).parents(".sourceCode").find("div.code").hide();
});
$("a.sourceLink").click(function(){
	$(this).attr('target','_blank');
});
/*]]>*/
</script>

</div><!-- end of page -->
</body>
</html>